package com.heima.feign.clients;

import com.heima.model.schedule.dtos.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-schedule")
public interface ScheduleClient {
    /**
     * 文章发布审核----发布延迟任务
     * @param task
     */
    @PostMapping("/api/v1/task/add")
    public void addTask(@RequestBody Task task);

    /**
     * 文章发布审核---消费任务
     * @param taskType
     * @param priority
     */
    @GetMapping("/api/v1/task/poll/{taskType}/{priority}")
    public Task pollTask(@PathVariable Integer taskType, @PathVariable Integer priority);
}
